import {
	mapGetters
} from "vuex";
import storage from "./storage";
import {
	getMyShareInfo
} from "@/api/game.js";

export default {
	data() {
		return {};
	},
	computed: {
		...mapGetters(["globalGameCtx", 'userInfo']),
	},
	/**
	 * 用户点击右上角分享
	 */
	onShareAppMessage(shareResultData) {
		const promise = new Promise((resolve, reject) => {
			if (this.userInfo) {
				return resolve({
					title: "邀请你开启甜蜜之旅",
					imageUrl: "https://cdn.osisx.com/runse/images/invite-card.jpg",
					path: `pages/runChat/invitePage?friendId=${this.userInfo.userId}&friendName=${this.userInfo.username}`,
				});
			} else {
				return resolve({
					title: "邀请你开启甜蜜之旅",
					imageUrl: "https://cdn.osisx.com/runse/images/invite-card.jpg",
					path: `pages/runChat/invitePage`,
				});
			}

		});

		return {
			promise,
		};
	},
	// 分享到朋友圈
	onShareTimeline(res) {
		console.log(res, "onShareAppMessage-----------分享到朋友圈");
		return {
			title: "境由心动",
			imageUrl: "https://cdn.osisx.com/game/image/247337192468455cb28be754a09f116f.png",
			path: `pages/linkInternet/linkList`,
		};
	},
};